package com.eb.test;

import java.io.IOException;
import java.text.DateFormatSymbols;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Created by Administrator on 2017/5/7.
 */
public class Main {

    public static void main( String[] args ) throws IOException, ParseException {
//        LuaProcess lp = new LuaProcess("C:\\Users\\Administrator\\Desktop\\Release");
//        lp.Create("http");
//        lp.Send("okokok!!你好，我也好。");
//        String rece=lp.Receive();
//        System.out.println(rece);
//        System.out.println("*************************");
        parserDate("周四, 07 十二月 2017 17:11:56 GMT");
    }

    public static Date parserDate(String stringDate) throws ParseException {
        final String[] WEEKDAYS = {"", "周一", "周二", "周三", "周四", "周五", "周六", "周日"};
        final String[] MONTHS = {"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"};
        DateFormatSymbols sym = new DateFormatSymbols(Locale.CHINA);
        sym.setShortWeekdays(WEEKDAYS);
        sym.setWeekdays(WEEKDAYS);
        sym.setMonths(MONTHS);
        SimpleDateFormat f = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", sym);
        return f.parse(stringDate);
    }
}
